package com.gp.gback.system.store.constants;

/**
 * Created by fox_lin on 17/8/6.
 */
public interface StorageConstatns {

    public class StorageType {
        public static String FACTORY = "1";
        public static String REGION = "2";
        public static String STORE = "3";
    }

    public class StoragePos {

        public static String STORE_POS = "8000";
    }

    public static enum StorageOperationType{

        DirectSales("DirectSales","自营"),
        ChainSales("ChainSales","联营"),
        Franchise("Franchise","特许"),
        EBusiness("EBusiness","电商"),
        ;
        // 成员变量
        private final String typeCode;
        private final String typeName;

        public static StorageConstatns.StorageOperationType getByCode(String code){
            for (StorageConstatns.StorageOperationType type: StorageConstatns.StorageOperationType.values()){
                if (type.getTypeCode().equals(code)){
                    return type;
                }
            }
            return DirectSales;
        }

        // 构造方法
        private StorageOperationType(String typeCode, String typeName) {
            this.typeCode = typeCode;
            this.typeName = typeName;
        }


        public String getTypeCode() {
            return typeCode;
        }

        public String getTypeName() {
            return typeName;
        }

    }

    public static enum StorageChannel{

        OnLine("OnLine","线上渠道"),
        OffLine("OffLine","线下渠道"),
        ;
        // 成员变量
        private final String typeCode;
        private final String typeName;

        public static StorageConstatns.StorageChannel getByCode(String code){
            for (StorageConstatns.StorageChannel type: StorageConstatns.StorageChannel.values()){
                if (type.getTypeCode().equals(code)){
                    return type;
                }
            }
            return OffLine;
        }

        // 构造方法
        private StorageChannel(String typeCode, String typeName) {
            this.typeCode = typeCode;
            this.typeName = typeName;
        }


        public String getTypeCode() {
            return typeCode;
        }

        public String getTypeName() {
            return typeName;
        }

    }
}
